<?php
/**
 * 谁来参展
 * User: adophper
 * Date: 2018/3/23
 * Time: 18:23
 */
namespace frontend\widgets;
use common\services\ExhibitionExhibitorServices;
use common\services\ExhibitorServices;
use yii\bootstrap\Widget;

class Exhibitor extends Widget {

    private $view = '@frontend/views/widget/exhibitor.php';

    public $params = [];

    public function init()
    {
        $service = new ExhibitionExhibitorServices();
        $res = $service->getExhibitionExhibitor(6);
        $exhibitorService = new ExhibitorServices();
        $total = $exhibitorService->getExhibitorTotal();
        $this->params['data'] = $res;
        $this->params['total'] = $total;
    }

    public function run()
    {
        echo $this->renderFile($this->view, $this->params);
    }
}